package com.warmheart.base.page;

import java.io.Serializable;

import com.warmheart.core.ignore.IgnoreFilter;
import com.fasterxml.jackson.annotation.JsonInclude;

public class BasePage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 分页导航
     */
    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = IgnoreFilter.class)
    private Pager pager = new Pager();

    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = IgnoreFilter.class)
    private int pageId = 1; // 当前页

    @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = IgnoreFilter.class)
    private int pageSize = 10; // 页大小

    public Pager getPager() {
        pager.setPageId(pageId);
        pager.setPageSize(pageSize);
        return pager;
    }

    public void setPager(Pager pager) {
        this.pager = pager;
    }

    public int getPageId() {
        return pageId;
    }

    public void setPageId(int pageId) {
        this.pageId = pageId;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}